home *** CD-ROM | disk | FTP | other *** search
/ Programming Microsoft Visual Basic .NET / Programming Microsoft Visual Basic .NET (Microsoft Press)(X08-78517)(2002).bin / 24 aspnet applications / aspnetapplications / outputcachingform.aspx < prev    next >
Encoding:
ASP.NET Web Form  |  2002-03-18  |  1.4 KB  |  30 lines

  1. <%@ Page Language="vb" AutoEventWireup="false" Codebehind="OutputCachingForm.aspx.vb" Inherits="AspnetApplications.OutputCachingForm" %>
  2. <%@ OutputCache Duration="10" VaryByParam="txtValue" %>
  3. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  4. <HTML>
  5.     <HEAD>
  6.         <title>OutputCachingForm</title>
  7.         <meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
  8.         <meta name="CODE_LANGUAGE" content="Visual Basic 7.0">
  9.         <meta name="vs_defaultClientScript" content="JavaScript">
  10.         <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
  11.     </HEAD>
  12.     <body>
  13.         <form id="Form1" method="post" runat="server">
  14.             <H1>@OutputCache directive demo</H1>
  15.             <P>This pages demonstates how the @OutputCache directive works. The page is cached 
  16.                 for 10 seconds -or- until you type a different value in the txtValue textbox 
  17.                 below. Just click repeatedly on the Refresh button, until you see that a new 
  18.                 time value appears.Comments in the source code show how you can control the 
  19.                 output cache feauture through code instead of using a directive.</P>
  20.             <P> </P>
  21.             <P>
  22.                 <asp:Label id="lblTime" runat="server"></asp:Label></P>
  23.             <P>
  24.                 <asp:Button id="btnRefresh" runat="server" Text="Refresh"></asp:Button></P>
  25.             <P>Type a different string to cache a new page
  26.                 <asp:TextBox id="txtValue" runat="server"></asp:TextBox></P>
  27.         </form>
  28.     </body>
  29. </HTML>
  30.